934f1e
@@ -116,15 +116,16 @@
public class CloseRegionHandler extends EventHandler {
       // TODO: If we need to keep updating CLOSING stamp to prevent against
       //       a timeout if this is long-running, need to spin up a thread?
       region.close(abort);
-      this.rsServices.removeFromOnlineRegions(regionInfo.getEncodedName());
     } catch (IOException e) {
-      LOG.error("Closing region " + regionInfo.getRegionNameAsString(), e);
-      if (this.zk) deleteClosingState();
+      LOG.error("Unrecoverable exception while closing region " +
+          regionInfo.getRegionNameAsString() + ", still finishing close", e);
     }
 
+    this.rsServices.removeFromOnlineRegions(regionInfo.getEncodedName());
+
     if (this.zk) setClosedState(expectedVersion, region);
 
-    // Done!  Successful region open
+    // Done!  Region is closed on this RS
     LOG.debug("Closed region " + region.getRegionNameAsString());
   }
 
@@ -154,18 +155,6 @@
public class CloseRegionHandler extends EventHandler {
     }
   }
 
-  /**
-   * @return True if succeeded, false otherwise.
-   */
-  private void deleteClosingState() {
-    try {
-      ZKAssign.deleteClosingNode(server.getZooKeeper(),
-          this.regionInfo.getEncodedName()); 
-    } catch (KeeperException e1) {
-      LOG.error("Error deleting CLOSING node");
-    }
-  }
-
   /**
    * Create ZK node in CLOSING state.
    * @return The expectedVersion.  If -1, we failed setting CLOSING.
